﻿#region Usings
using System.Globalization;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
#endregion

namespace BK.UI.Web.AppCode
{
    public class MultiCultureMvcRouteHandler : MvcRouteHandler
    {
        #region Instance Methods
        protected override IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            //var culture = requestContext.RouteData.Values["culture"].ToString();

            //var ci = new CultureInfo(culture);
            var ci = new CultureInfo("uk-UA");

            Thread.CurrentThread.CurrentUICulture = ci;
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ci.Name);

            return base.GetHttpHandler(requestContext);
        }
        #endregion
    }
}